<template>
  <div>
    <el-form-item :label="label">
      <el-upload
        action="/bnu/api/upload"
        list-type="picture-card"
        :file-list="aliveValue"
        @on-change="changeValue"
        :on-preview="handlePictureCardPreview">
        <i class="el-icon-plus"></i>
      </el-upload>
      <el-dialog :visible.sync="dialogVisible">
        <img width="100%" :src="dialogImageUrl" alt="">
      </el-dialog>
    </el-form-item>
  </div>
</template>
<script>
  export default {
    name: 'ttUploadImg',
    data() {
      return {
        aliveValue: this.value,
        dialogImageUrl: '',
        dialogVisible: false,
      };
    },
    props: {
      value: [Array],
      label: [String],
    },
    mounted() {

    },
    computed: {},
    watch: {},
    methods: {
      changeValue(file, filelist){
        console.log(file)
        console.log(filelist)
//        this.$emit('input', val);
      },
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      }
    }
  };
</script>
<style scoped rel="stylesheet/scss" lang="scss">
</style>
